<template>
  <el-row class="tac">
    <el-col :span="12">
      <h5 class="mb-2">用户菜单</h5>
      <el-menu
        class="el-menu-vertical-demo"
        default-active="3"
        @open="handleOpen"
        @close="handleClose"
        router="router"
      >
        <el-sub-menu index="/home/1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>我的项目</span>
          </template>
          <el-menu-item-group title="学以致用">
            <el-menu-item index="/home/todos">任务清单</el-menu-item>
            <el-menu-item index="/home/netease">仿网易云</el-menu-item>
            <el-menu-item index="/home/living">生活费</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>大学时光</span>
        </el-menu-item>
        <el-menu-item index="3">
          <el-icon><document /></el-icon>
          <span>个人简历</span>
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon><setting /></el-icon>
          <span>哈哈哈哈</span>
        </el-menu-item>
      </el-menu>
    </el-col>
  </el-row>
</template>


<script setup>
import {
  Location,
  Document,
  Menu as IconMenu,
  Setting,
} from '@element-plus/icons-vue'
import { ref } from 'vue'
const router = ref(true)
const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>

<style scoped>

/* 用户菜单 */
.mb-2{
  width: 280px;
  height: 60px;
  line-height: 60px;
  font-size: 15px;
}

:deep(.el-menu){
  width: 280px;
}

</style>